
import 'package:intl/intl.dart';

class Utils{
  static const String CHANNEL_NAME = "CHANNEL_NAME";//通道名称
  static const String METHOD_REQUEST_PERMISSION = "method_request_permission";//获取权限

  /// 是否不是空字符串
  static bool isNotEmptyString(String ?str) {
    if (str != null && str.isNotEmpty) {
      return true;
    }
    return false;
  }
  /// 是否不是空List
  static bool isNotEmptyList(List? list) {
    if (list != null && list.isNotEmpty && list.length > 0) {
      return true;
    }
    return false;
  }
  
  static String timeToDate(int ?times){
    var date = DateTime.fromMillisecondsSinceEpoch(times!*1000);
    var formatter = DateFormat('yyyy-MM-dd HH:mm ss');
    return formatter.format(date);
  }
}